package com.baiqian.doupo.douji;

import com.baiqian.doupo.block.BlockRegistry;
import com.baiqian.doupo.capability.douqi.IDouQiCapability;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Vector3d;

public class DouJi_HuoDing extends DouJi{
    public DouJi_HuoDing(){
        super("火鼎", 3,4,3,1,3*20,
                1,0.0,0.0,0.0,1,1,false,false);
    }

    @Override
    public void useEx(IDouQiCapability l, PlayerEntity entity) {
        Direction direction = entity.getAdjustedHorizontalFacing();
        BlockPos blockPos = new BlockPos(new Vector3d(entity.getPosX(),entity.getPosY(),entity.getPosZ()).add(new Vector3d(direction.getXOffset(),direction.getYOffset(),direction.getZOffset())));
        if(entity.world.getBlockState(blockPos).matchesBlock(Blocks.AIR))
            entity.world.setBlockState(blockPos,new BlockState(BlockRegistry.huo_ding.get(),null ,null));
    }

    @Override
    public void addEffect(LivingEntity entity) {

    }

    @Override
    protected void createEntity(IDouQiCapability l, PlayerEntity playerEntity) {

    }
}
